Your history suggests that the phlegm and cough are related. Postnasal drip is one of the most common causes of chronic cough. The negative blood test to cat does not rule out cat allergy. That could be the cause of the phlegm, especially since the problem began when you inherited 2 of cats.
The negative gastroscopy reduces the likelihood of gastroesophageal reflux disease (GERD). I did a search and could find no evidence of cough due to tapazole. I believe that is a most unlikely cause, especially since you have been taking it for3 years prior to the onset of your cough.
Check with your doctor about being treated for allergic rhinitis with nasal washes, followed by a nasal steroid spray, and possibly also with a leukotriene antagonist such as Singulair® (montelukast sodium). Also keep the cats out of your bedroom.
Good luck