I don’t understand what you mean by “I have done that”, because I didn’t tell you anything to do. I listed a bunch of things that might or might not be true in your map and suggested that the number of those things (and others I didn’t list) that are true will make autocast loops more complicated to design and implement.
The function you have shown is for modifying parts of an ability after game start (instead of in the Object Editor when making your map). It changes fields that use real values that can scale with ability level (like cooldown or damage dealt, but not something like cast time which isn’t level-dependent).
What are you trying to do with that function? It also doesn’t exist on older versions of wc3 or may simply be nonfunctional on old versions that do have it.