As someone in recovery, I would tell you that you need to do things that are healthy and foster your sobriety.
This is the kind of question you need to take to an attorney. We cannot speculate how a judge would respond to any variety of factors involved in a custody situation.
An attorney will help you by advocating for your rights as a parent.
In all honesty, I think any response beyond that would constitute legal advice, which is not fair to you as it may have no bearing or resemblance to what you're dealing with in real life.