Evasion, miss and counter chances are evaluated before the damage formula is executed. Unless the action is a success the damage process is skipped, regardless how the damage formula looks like.
The result of the damage formula is usually the result of the last command executed, so the order is still important.
[...] is not running the damage formula, only the common event.
What do you mean by that? Does the skill deal not the damage you'd expect it to do? Or something completely different? The damage formula is only used to calculate the skills base damage, which is the first step of the damage calculation. The target is not supposed to take any damage and modifiers like element affinity are not considered yet.
If you want to do something even when the attack misses or even is completely prevented
(counter), using the damage formula might not help you that much.
What do you want to achieve exactly? Especially, what should happen when...
- ...the attack is reflected
- ...the original target is substituted by another one
- ...the action fails because the attacker can't pay its cost / can't move / is silenced
- ...the action gets replaced because the attacker is confused
...if those events can occur in your project in the first place?
For example, you can access which target was selected for each action before the action is executed unless it is determined randomly. However, it's not guaranteed the action will actually hit that target in all cases of course.
Edit: If I understand your posts correctly you want to call a common event when the skill is used on a particular target? And even call it when the actual attack fails for any reason, including being unable to act, miss or get countered?