How do i parameters in a mesh's materials during runtime?

So i am using AnimToTexure plugin and i successfully baked animations into my mesh material instances. When I change the StartFrame and EndFrame params manually in the material instance details panel, the animation changes correctly.

But when I try to do this at runtime using a bp (with dynamic material instance and set scalar param) it simply doesn’t work. Here is my Code:

As you can see my mesh has two materials-i have checked with prints and these are the correct indices. Any other idea? thanks in advance.