Maxwell could get English language classes, a course of anger management therapy, a dictionary in large print (to widen his vocabulary & enable him to more clearly see how they are spelt) and a lifetime's supply of hynotherapy courses to wean him from his compulsion to swear.
Failing that, Mary could cast a spell that would make him say "I miss my tutu" or "Time for my facial" in a very high-pitched voice every time he wanted to swear