Okay, to recap in a bit more structured way: the skelani_set_animation(atkanimation,(statecntr-atkwarmup)/atkduration) line should be multiplied with the number of frames in the animation, and any skelani_set_animation(atkanimation,1) should instead set it to the final frame.
It might be easier to do these changes if you add this line right below "statecntr++" to read out the length to a variable:
var anilen = global.skelani_animation_length[atkanimation];
Then use anilen as the length in the code:
skelani_set_animation(atkanimation,anilen) //Originally ended in "1"
skelani_set_animation(atkanimation,anilen*(statecntr-atkwarmup)/atkduration) //The interpolating one
If it acts weird, try setting anilen to global.skelani_animation_length[atkanimation] - 1 instead.