If you pay off your debt, you can apply for a reduction or exemption and don’t wait for a judgment! This means that the amount you need to repay has been legally determined, and this amount has legal effect.
Therefore, if you want to negotiate for reduction or exemption after the judgment, you need to negotiate with the creditor, repay the money after negotiation, and then the court will close the case. If the creditor doesn't agree and requires you to pay back 40,000, then you don't have to negotiate and just raise the money honestly.