How to check if Skill Selection was cancelled?

I've got a skill that should consume an item after the skill was selected (not performed). I managed to do this part, but if the player decides to cancel the selection, the consumed item won't be returned back, that's why I need to somehow find where in the code the player cancels the skill selection, so I could undo changes. If anyone has ideas, I'll be very thankful!
Why does the item need to be consumed then? Why not just do it immediately at the beginning of the skill? Or even as a custom cost?

You'd be looking at Window_Selectable.processCancel() and overwriting it as a method of Window_BattleSkill to do specific functionality there, but...I think this is an over-complicated way of doing what you want.
Why does the item need to be consumed then? Why not just do it immediately at the beginning of the skill? Or even as a custom cost?

You'd be looking at Window_Selectable.processCancel() and overwriting it as a method of Window_BattleSkill to do specific functionality there, but...I think this is an over-complicated way of doing what you want.
I think you're right, custom cost works just alright with what I need! Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-if-skill-selection-was-cancelled.170727/