Unless the abuse is legally actionable (sexual discrimination or abuse, racist comments, etc), it is likely that your best course is to put your head down and just write. You may be able to get some advice from a local office at your university, however, or, in some cases, from the head of department.
If it is legally actionable, then you need to talk to a lawyer, either inside the university system or on your own.
It is difficult to deal with powerful bad actors and difficult to avoid all negative consequences. But you probably need advice and support from someplace closer than this forum and with whom you can be more open.
But if you can just finish, somehow, you can leave the situation behind, though you may still need allies to deal with recommendations, etc.
However, if the abuse is continuing, you should try to document it, even if it is in a journal in which you date occurrences with a clear description. If there are witnesses, it would be good, if possible, to get statements from them as well.
I also wonder if the professor's colleagues recognize this as an issue and could serve as your surrogate in correcting the problem. He or she may have power over you, but not over the entire faculty. Allies.