Anise will diminish the most hacking cough to where it is no longer irritating.
A hacking cough is most commonly observed in chronic catarrh of the upper air-passages, in pharyngitis and laryngitis, and especially in beginning pulmonary tuberculosis; hence its importance.
It'll take a hacking run to find the roots of such a Byzantine bug.