Hello and thanks for trusting me to help you and Coco today. I am a licensed veterinarian with over 25 years experience and would be happy work with you.
If she has a history of vomiting that has not progressed to more regular occurrences, even when she hasn't eaten, I would be worried about underlying GI disease such as inflammatory bowel disease (IBD) or even intestinal cancer. Pancreatitis can be involved as well but it can be a challenge to confirm. Unfortunately, any of these can be present and there can be no other abnormalities noted on bloodwork, xray or even ultrasound, although these tests should be run to rule out other conditions that present with the same symptoms. There is a specific GI blood panel that can be requested and if abnormalities noted, can lend support to either pancreatic or intestinal disease. The only way however, to confirm the diagnosis is with a biopsy of the intestine. This can be done via endoscope, but is better performed with an exploratory surgery. The problem with this is that many cat owners are not willing to pursue the diagnosis by these means. It is for that reason that many cats are "suspected" to have IBD or GI cancer as the cause of their weight loss and anorexia once all of the other easy to find things have been ruled out.
I suspect that may be where you are at with your Coco. If that is the case, I would start with an examination by your veterinarian and a GI work up. You can also discuss with your veterinarian the pros and cons of proceeding with a biopsy to confirm the diagnosis in her situation if they feel it would help. Even if you choose to not go the route of biopsy, she may benefit from a course of corticosteroids and perhaps a hypoallergenic diet as sometimes food allergies contribute to the IBD. There are other medications and supplements used to manage IBD as well. Steroids help many cats with either of the two conditions to regain their appetite and gain weight, but if there is intestinal cancer, the result may be short lived. If cancer is confirmed with a biopsy, she may do better with other chemotherapeutic drugs to put her in remission for a longer period of time. If the cause is IBD only, you may be able to decrease or even stop the steroids after you see improvement. Biopsy and confirming the diagnosis is always the better choice, but not always feasible for every case. I would not offer milk of magnesia to a cat that is vomiting, especially without knowing if she is constipated or not. Your vet will be able to tell after an exam. It is likely that part of her lack of energy is due to anorexia and dehydration from not eating, and she would probably benefit form fluid therapy. Your vet may also prescribe appetite stimulants to encourage her to eat better.
Here are a few links you may find informative.
inflammatory bowel disease (IBD)
I hope this is helpful. Please let me know if you have ANY other questions. My goal is to give you 100% satisfaction and if you are not yet satisfied, please reply so I can clarify for you.
My posted replies are for general education only and not meant as a diagnosis. Only after a thorough veterinary examination can a diagnosis for your pet be made and specific treatments be advised or medications be prescribed.