MZ ARPG Plugin - Actor Sprite Change on Attack

using the official ARPG plugins for MZ that were released on steam. I'm trying to make it so when the normal attack button is pressed, the player sprite initiates their own swing animation, so they're not just a static sprite with a sword swinging in front of them. Below is the common event for "Normal Attack" in the sample project for the official MZ ARPG plugin, with my "attempt" in the red box. I thought if I put in the variable to change the player sprite for the moment the attack button is pressed, direction dependent, that would do it, but it just broke the event. I think it's probably something close to what I've tried, but I'm not sure how to integrate anything new into these sample common events, I have no JS scripting ability.
Any advice would be much appreciated.
MZ Screen 1.png
I have moved this thread from JS Plugin Releases (RMMZ) to JavaScript/Plugin Support.
What do you mean "broke the event"? I tested this quickly in the sample project (just the 'change image' and 'turn'), and it seemed to work if I put that movement route close to the end of that 'normal attack' common event (above the 'weapon animation' plugin command). If I put it near the top, it seemed to have problems registering the hits on the enemy, don't know, didn't test it much. You also don't need that 'if button ok is pressed', because that common event only runs when you press the button to attack.
What do you mean "broke the event"? I tested this quickly in the sample project (just the 'change image' and 'turn'), and it seemed to work if I put that movement route close to the end of that 'normal attack' common event (above the 'weapon animation' plugin command). If I put it near the top, it seemed to have problems registering the hits on the enemy, don't know, didn't test it much. You also don't need that 'if button ok is pressed', because that common event only runs when you press the button to attack.
Thanks for the reply. By "broke" I just meant, it caused a string of errors, and closed the game, which I didn't screenshot. Thanks for taking the time. I tried it the way you suggested, and I got it to work. I'm not sure if other more experienced scripters whom are using ARPG, would do it this way, but it serves the purpose I intended. Thanks very much!

Original thread: https://forums.rpgmakerweb.com/threads/mz-arpg-plugin-actor-sprite-change-on-attack.162241/