Hello. I am going to be perfectly honest with you and tell you that the issues with the medication are hurting you here and will continue to hurt you in a big way. If you are required to take medication by your doctors, then you should make sure that you take the medication and that you keep it out of the reach of your child or children. You should also try to talk to your own mother and get her on your side in this matter -- when a judge sees a mother testifying against custody for their own child, that tells the judge a lot and really works against you in the grand scheme of actually being granted child custody here.
Overall, the CA courts consider all relevant factors when considering who ultimately gets custody of the children and they use a test set forth in the CA statutes called the "best interests" of the child test. The factors used to determine what custody arrangement is in the best interests of the child are as follows: parenting skills, living arrangements, mental and physical health of each parent, religious and cultural considerations, need for continuation of a stable home environment (not bouncing the children back and forth between the parents every few years if it can be avoided), whether or not the custodial parent grants the opportunity for the other parent and extended family members are given the opportunity to interact with the child, adjustment to school and community, parental use of excessive discipline, and evidence of parental drug and alcohol use.
In order to get to the bottom of all of these issues in a hotly contested custody case, the court might appoint a guardian ad litem / custody investigator to actually investigate all of these items and report back to the court regarding what the guardian feels is an acceptable custody arrangement. All of the above factors and any other relevant factors will be considered in this determination. While having their own bedrooms might help out here in this situation, that fact will not be the main factor when the judge determines if you can have custody of the child returned to you in this situation.
If you can show that you have overcome your medication issues and you can show strong, positive aspects on many of these factors, while at the same time trying to show that your ex is weak on many of these issues, then you may have a chance of regaining custody -- but I will be truthful here when I tell you that it will probably be a long process and you will probably have to slowly move from your visitation rights into a more of a custodial relationship over time.
I hope that giving you this information helps.
Please press the GREEN ACCEPT BUTTON so I will be paid for my time