Making a short post, which is nigh impossible for long-winded me.
Coughing happens because the air passage has narrowed. That's it. Use an inhaler to relax the smooth muscle of the respiratory tract and get real albeit temporary relief and try to cough up the mucus if it's possible.
People think of inhalers for asthma, but they can help anyone. It's why breathing treatments (expensive) are given in the ER for sparms of coughing.
Glycoaminoglycans (GAGs) make up mucus. They're little building blocks that lubricate the airway and trap and remove the foreign particles caught by waves of cilia in the respiratory tract. If you eat less of certain foods, then your mucus production will go down. Other food encourage the production of mucus.
Usually you want to eat lots of foods rich in omega 6 fatty acid, but not while with a respiratory illness. A person with cystic fibrosis in which lots of mucus is formed should avoid them especially. See:
[link to www.livestrong.com
Dairy...same thing. Wheat same thing.
Fresh fruits and veggies cut down on mucus production.
[link to www.webmd.com