Thank you for your question. My name is Dr. Stacy. I have been a small animal veterinarian for 14 years and I'd like to help with your question.
Bad breath in dogs is often associated with a tooth abscess or really bad dental disease or gingivitis. However, there are also a number of internal problems that can cause bad breath too. Kidney disease commonly causes bad breath. Diabetes can cause the breath to smell like acetone if they have a condition called diabetic ketoacidosis. Some cancers, particularly of the stomach or intestine, I have found cause bad breath. And probably the worst breath can be associated with a cancer of the mouth called squamous cell carcinoma. This cancer causes a smell like dead tissue.
So.... it could be number of things. As far as the coughing/gagging..... that may or may not be related to the bad breath. If she has and infection or tumor in her mouth it may be situated in a position to trigger the gag reflex. However, the cough may be unrelated.
Regardless, at 13 years of age I would recommend getting a veterinarian to look at her. If it is just a bad tooth then that would be great, but at this age I would worry about a tumor or kidney disease. This is especially a concern if you are seeing other problems, such as weight loss, drooling. or increased thirst.
I hope that helps, but if you have more questions please let me know!