Hello!
Hey I've been there. John Lyons mentions to give your horse "3 seconds of H*ll" (making them think they are going to die for at least 3 seconds) and I have heard this works but what I find is most effective kicking them in the cannon bone (shin).
If you have mouthy, nippy horse and you smack/hit/whack them in areas that they can see such as head, neck, shoulders, chest it will only either make them aggrivated or quicker because they can see the hand coming. Any smacking on the head/face will also make them headshy.
But if you are standing directly in front of your horse and he/she reaches to bite, quick give a smart kick to the cannon bone (either). The horse cannot see his feet and if you are quick enough he'll never know it was you. Also, you're not making him/her headshy.
After the 4-5th time, they will reach to bite, stop, and try to look down. Make sure it's very quick (best within 3 seconds of a bite or a nip) or they will not be able to associate the pain in their leg with the biting. Trust me, it works and it is funny to see them actually trying to figure out why their leg hurts every time they try to bite.
I had a 2yo APHA stud colt who's previous owners had fed him WAY too much grain and kept him in a small area with nowhere to exersize and run off his excess energy. He was so bad at biting, nipping, rearing etc. I immediately turned him in with several geldings who took NO crap from another horse. I let him stay in the big pasture with those boys for over a week and no sweet feed. He settled down after that, enough for me to begin some decent training where he could pay attention. I really couldn't blame him however, being enclosed in a tight little area that he was, and being fed almost 2 gallons of 12% A day with nowhere and no need of it.
Hope that helps. Safe, and effective. Other members might give you some more ideas. Hope you get it worked out! I know that's not fun...
Ps. WELCOME to the forum

!