How to cancel a Common Event attached to a Skill if said skill fails?

Right now the Common Event runs regardless if the skill hits the enemy or not.
How do I make the Common Event run only when the skill successfully hits its target?
Can I cancel the Common Event if the attack miss?
Have the skill inflict a state on the target, then have the common event check if the target is inflicted with the state, and if yes, perform event. If not, skip to end.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-cancel-a-common-event-attached-to-a-skill-if-said-skill-fails.96061/