The only way to save your credit for now will be to make the payments on the mortgage and keep it current.
(In the divorce proceedings you can always have the judge order your STBE to reimburse you his share of the payments)
Even if, in the divorce, the judge decrees that your STBE must pay the mortgage, that does not change the relationship between you and the mortgage lender. You will ALWAYS be responsible for it.

That being said, you can "force" your ex to refinance it under his name. How good is HIS credit?
Otherwise, you can also sell the house.
But, yes, speak to a GOOD divorce atty ASAP!!