The attack animation in psm_melee uses skelani_set_animation to explicitly set the animation frame instead of playing it automatically, this is why you don't see the new frame at the end play out. Since all the default attack animations have 2 frames, the hardcoded 0 and 1 will work, but one thing you could do if you want more intricate animations is to use global.skelani_animation_length[argument0] instead of 1 when setting the animation, and for the line that goes
skelani_set_animation(atkanimation,(statecntr-atkwarmup)/atkduration)
you'd instead use
skelani_set_animation(atkanimation,global.skelani_animation_length[argument0]*(statecntr-atkwarmup)/atkduration)
(which means you interpolate between all the frames instead of just the first two)
Since indexing starts at 0 you might need to use (global.skelani_animation_length[argument0]-1) instead of just global.skelani_animation_length[argument0] to prevent the animation from looping back to the first keyframe at the end, I don't remember if the length is inclusive or not.