Passing out due to excessive hard coughing is not at all unusual, but it's also not something you want going on, as you can get hurt on your way to the floor. The cough is the culprit, and you're going to need to find something that will help manage both the post-nasal drainage and the cough. An antihistimine along with an expectorant. For the latter purpose (to loosen the secretions and help cough up what's down there without knocking yourself literally out) guaifenesin, brand-name Mucinex, is good. Also any cough medication that contains dextromethorphan should help.
In the meantime, please do your best to not let the ticking and congestion lead you into paroxysms of coughing, and if this is impossible then please make sure you're sitting down when you start to cough so as to avoid injury by falling. Try your best to avoid getting into these "spells", as they also aren't especially good for the pressure they cause inside your head. Again, this is a fairly common problem, but it's no fun. No need to panic, but please take the appropriate precautions when it's happening. If it doesn't resolve within a day or two you'll need to be seen by a regular MD as you may have a bacterial infection and might need an antibiotic to get this cleared up.
Best of luck to you. Please follow up with us as needed.
John Kenyon, EMT, CCT
Non-invasive cardiology tech, Emergency and Critical Care technician, Critical Incident Stress Mgmt. specialist