Cancelling a paperZD animation

I have a character that can perform spells. If used a sprite is summoned in front of the player with an animation. I want the user to have to keep holding down the spell button (rmb) to use the spell, if they let go earlier the spell is cancelled. What I have now is when I click once without holding down it summons the sprite and plays the full animation. How do I cancel the animation when the button is released? I am using paperZD and it’s a 2d game.