I am very sorry to hear about your older pup's lethargy, lack of appetite, slightly loose stools and cough. I understand that she needed to lose weight, but weight loss without trying in an older dog is always concerning. 3 pounds is a lot of weight for a small dog.
Was any bloodwork checked at her recent physical?
Possible causes of gagging and decreased appetite include a change in diet, dietary sensitivities or allergies, or eating things that they should not like too many fatty table scraps or garbage, bones etc. Metabolic organ failures (kidney or liver disease or diabetes), pancreatitis, inflammatory bowel disease or even infiltrative cancers are possible. If she is not spayed a reproductive tract infection (pyometra) is also possible. Heart disease is another reason for loss of appetite and a cough, but I would have expected some sign of that 3 weeks ago, such as a heart murmur.
If she isn't eating normally that can lead to lethargy, or it is possible that whatever is leading to stomach upset is making her lethargic too.
Has she eaten anything she should not have recently (toy pieces, bones, garbage)?
Any changes in food or treats?
Ideally at her age she should see her veterinarian for an examination and some testing tonight or tomorrow morning as well as supportive care like fluids and anti-nausea injections.
If that isn't possible right away you can give her acid reducers to try and settle her stomach. Either:
1) Pepcid-ac (famotidine) at a dose of one half of a 10mg tablet per 10 to 20 pounds of body weight every 12 hours.
2) Prilosec (omeprazole) at a does of one quarter of a 20mg tablet per 10 to 20 pounds of body weight every 24 hours.
These will reduce stomach acid and could help settle her stomach. These can be used for several days if necessary as they are very safe.
A couple hours after giving one of the acid reducers you can offer clear broths to drink or a canned food and warm water gruel to tempt her to eat.
No food for 12-24 hours. Small amounts of water only.
After her food fast then start a bland diet of 1/3 boiled, lean hamburger (or boiled, white, skinless chicken) and 2/3 boiled white rice. Give small meals several times a day. Feed the bland diet for several days, then start mixing in her regular diet and slowly convert her back.
If her lack of appetite continues then she may need injectable medication from a veterinarian to get her stomach upset under control.
So watch her for continued refusal to eat even with the acid reducers, blood in her stool or vomit, or a fever (more than 103.5F rectally), or a tense, painful belly. If any of those occur it is time to seek hands on veterinary care.
Please let me know if you have any further questions.