How to change animation blend type via animator scripting

I need to change my animation layer blend mode from “Additive” to “Override”. I know i can do it by

animation["leanLeft"].blendMode = AnimationBlendMode.Additive;

But the problem is that i have animator component on my gameObject instead of animation. So i need a way to get the reference to specific animation layer via animator.

Thanks in advance

I didn’t find the solution, but i found the workaround. My layer always have override blend type and instead of changing this via code i just change the weight of the layer.
Hope someone find this helpful.

Another workaround if you need a layer to be additive and overriding in different circumstances, is to simply make two equal layers, each with the other option. Activate them via Blend Weight.

Animator docs actually contain a lot of information including how to reference layers and states, currently playing etc etc, however I have never found a way to simply change the Blendmode.