Applying States AFTER Damage

To be clear, I don't want this to happen for a specific skill, but all of them.

I just want the order changed, from "stun -> formula", to "formula -> stun" (as an example, I mostly want it so skills can apply weakness statuses to certain elements so later skills of that element will deal more damage to the target, but without insta-boosting themselves).

I believe it would be relatively easy to code.

Original thread: https://forums.rpgmakerweb.com/threads/applying-states-after-damage.132073/