Is there any support network for partners of mental health patients available where you are?
If he's not taking his medication you have to speak with his doctors and decide together the next steps. I'd have him admitted to hospital actually if he's going to end up harming himself and his family. Which he is by depriving you all of sleep.
Btw, a person who is not in full use of his mental faculties cannot divorce or marry, so if he's not lucid right now I wouldn't get too stressed about his threats (double check with a trusted alim).
You guys are in our duas inshallah.