How to fix opacity mask in material function?

Hey there!

I downloaded Environment Set from NatureManufacture.
Now I wanted to add my snow material on the leaves of the tree. Therefore I made the leaves material to a material function but the opacity mask seems to be ignored there. See the pictures below:

This is the original material:

This is the copy&pasted material function with no working opacity mask:

This are both materials blended, but it’s ugly with the not working opacity mask.:

So my question is: How do I fix this problem with the opacity mask in the material function or in the snow-blended material? I hope you can help me!

the opacity mask isn’t working because the blend mode is set to opaque rather than masked. it’s also not two sided.

Thank you soooooo much!