So sorry to hear that you have been suffering from this cough and bad taste for such a long time now. Hopefully you are already feeling better by the time you read this. If you have not seen a physician, then I would encourage you to follow up with your doctor
about your complaint. As you mention, those who smoke do have a higher risk of developing numerous conditions, and it is common for normal infections to persist for a longer time due to the decreased natural healing ability of the body (as well as the chronic state of inflammation that is caused by smoking). Hopefully, there will be a silver lining in that this cough may encourage you to stop smoking for good. Regardless, any cough that persists for that amount of time should be evaluated by a physician. A productive cough can be a sign of a persistent infection, but so can coughs that do not bring anything up. Your doctor may need to culture some of the sputum that you are coughing up, or perform other tests such as getting a chest x-ray
to make sure that everything is working the way that it should. Please speak with your doctor.