Have the vets run any blood analysis type of work?
It is hard to determine without lab tests and radiographs. Stool can be discolored by things she is eating. Eliminate all table scraps and treats. Stay with strictly her dry dog food, middle of the road brands like Purina, Science Diet etc. If the stool remains loose, you may be dealing with a developing food allergy and need to go on an elimination diet trial with a novel protein. The gagging of bile usually indicates GI upset, dietary indiscretion, like scraps, treats, garbage sack attacks. That is why you need to limit what the pet eats so you can determine if it is able to adequately digest the food. In actuality, she's probably not coughing from a respiratory function disease, but rather the preliminary stages of gagging and vomiting.
I hope this is helpful. Please push ACCEPT and thanks!