A cough like this that is going on for a long time definitely needs to be evaluated by your primary care doctor
! There are many possible causes of this cough, and only your doctor will be able to perform a complete physical exam and help you get to the bottom of the issue.
First, it will be important to rule out an effect of your smoking as the cause of your cough. For example, lung diseases from chronic smoking can often cause cough. Your doctor can evaluate this and also can help you connect with resources to quit or cut down on smoking if this is something you desire!
The next thing that comes to mind is allergies, especially given how you say you have nasal stuffiness and discharge with the cough. Inside allergies from mites and mold are very common, and they are often worse at night as the mites and mold tend to concentrate in the bedroom (carpet and mattress). There are, fortunately, very effective treatments for these allergies that your doctor can discuss with you.
Finally, acid reflux
(heartburn) is a common cause of cough at night, as the acid from your stomach washes up and irritates the lungs.
Start by seeing your doctor as soon as possible!