Do you have any legal docs in place regarding the care of the children? If you have custody at present I would get that in writing. It can be a legal agreement through you both or a court order. Don't know where you are so hard to advise.
If he abuses or threatens you by text, lock it in to your phone & take it to the police station. they will record it & speak to him about it. Sometimes it's enough to scare them off.
Rehab could be used against him for custody of the kids.
Only speaking in my experiences & in my country.
Hope this helps.
Hugs.