Ugh. It is really unpleasant. So terrible.
I agree with tecomsin. You should search for a new job right now. Even if they failed to get you fired this time, they would try again later. It's such a toxic place. I know you need money, but you must also get out ASAP.
I know you're a smart woman and you must have documented everything. Show those evidence to the CEO, including the time when your boss tried to take your credits. I hope it would end well.