Prior to the court date, the judge and the prosecutor should be told of his intentions - be it a threat, a promise or empty words. They show his inability to put the welfare of his children first, thus his inability to care for them. And the judge can order counseling or placement for mental health care for your son.
I'm sorry you are dealing with this painful situation.
Please take care of yourself, and know that his actions are outside of your control.
Shalom!