Override avatar mask in layer

I have an override controller which is used to change animations on my characters, but the animator has multiple layers, each with a different avatar mask.

What I would like to do is change the avatar mask for each layer in code when the character loads, as their bones are different and they need different masks for the layers, I can’t seem to find where to do this.

As of now, I don’t think there is solution for this. I had the exact same issues as you and I searched all day for a work around with any success. I’m forced to make a new Animator Controller for each characters that have different rigs.
Animator Override Controller allows you to override animation clips, but it seems like Unity didn’t foresee that we might also need to override Avatar Mask as well, I hope they fix this soon.