I honestly think you should consult with your mom first if you feel you can trust her. I know she wants what is best for her daughter or granddaughter. I honestly believe she would want you to stop using to. Since she has custody she might be allowed to prevent you from seeing her until you recover or enter some program.
Honesty please for your child get help to quit. I do also concern about you losing weight and everything too.... There should be no reason to fear asking for help to quit.
Asking your doctor you could hide it from your mom if you are not comfortable telling her, but at some point in recovery or after words revealing your struggle and vulnerability to are working to strengthen to overcome will be a important step to move forward. If you are afraid to go to the doctor alone tell your mom and she can come with and can be reinforcing support, extra proof you want to get better, and also proof that your child will be in safe custody until you are able to take care of your child as they deserve like any person including you.
Please keep us update here. I'm sure if you make the hard choice to make a change and stop your use not only will you find supportive people here, but also a lot of people who can give great advice with that struggle. I wish you and your family the best in your journeys and hope your paths wind together forever.