@mtnagel Have you tried running the machine (empty) with vinegar instead of detergent? Doing that regularly might help.
My neighbor cleans his washing machine by doing an empty load with bleach and something else… Maybe a load with vinegar? I’d never heard of cleaning a washing machine before.
I had to replace the mixing valve in my shower several times because of hard water. I’d remove the valve, soak it in vinegar and replace it. Moen even sent me another one so I had a demineralized one on hand. But it’s a tight connection and after I had to call the plumber (again) to do the exchange I got a water softener.