The quick answer is unfortunately it depends.
If we break this question down, there are three ways coffee would likely be able to effect a cough:
- The coffee directly interacts with virus (and it is most likely a virus) causing the cough
- Coffee could directly effect your immune system in such a way that it changed your body's ability to respond to the pathogen
- Coffee could be directly interacting with your nervous system which induces the cough reflex (neurogenic cough is a real problem)
For item 1, I've seen some evidence that coffee might actually help stop flu. For the common cold, which is mostly likely (*) one of a few viruses, I couldn't find any evidence of caffeine or the other known biologically active components of coffee effecting them one way or the other. There could be another interaction here that we don't know about it, and it could be positive or negative, so at the moment this might be a slight reason to drink coffee, not avoid it.
(*) It's worth noting I disagree with the breakdown of viral prevalence listed in Wikipedia, and have discussed as much in a Bio.SE answer.
2) Ok there has been a looooot of research on caffeine and the immune system, especially when related to exercise. Some will say it helps, others not much (especially under usual conditions), and an honest review on it concludes that there are too many other factors that dictate whether caffeine has an effect (with exercise) that we can't really know. But this when considering healthy patients. With sick cells, animals, or people we can know more.
At really high doses caffeine can be anti-inflammatory, but it's probably not a good idea for the general public to be dosing that much caffeine.
This is where things get a little confusing and more relevant. At much more normal doses, caffeine is proinflammatory in the lung. So if you have an on going infection in the lung, you don't want to encourage the inflammation (which is probably causing the caugh).
That said, if you chronically drink coffee, your body may have tolerized to it, and the effect could be minimal (might be minimal anyway, see the sports guys).
Number 3 is actually a lot harder, as things can very based on a lot of other factors (like tolerance). If you have a caffeine overdose, a lot of bad things can happen. One of them is that nerves might fire action potentials at lower thresholds, which could mean the nerves detecting the inflammation in your lungs could fire more easily.
Chances are, however, that they won't, and you won't be drinking an unusual amount of coffee.
To conclude, in an acute infection I would recommend avoiding caffeine, but it won't cause an undo amount of harm. Decaf will even have the other compounds whose benefit would otherwise be swamped out by caffeine.