Common event before the end of a fight (Resolved)

Good morning,
I need to know if it is possible to launch a common event right at the end of a fight. After doing some research, I saw that some plugins offer this kind of thing, but I really need my event to trigger even before the victory message at the end of the fight.
I'll explain my problem in more detail, maybe someone will have an idea for a better alternative.

In my project I use many state alterations.
The display of these alterations being limited, I sometimes use the portrait of an actor to give information to the player.
Here is an illustration for you to understand better. I have indicated with a red arrow what I am talking about.

Spoiler: Picture 1
3.png

As you can see, I use many plugins. One of them is "Victory Aftermath" by Yanfly which modifies the end-of-fight message.
Here's what it looks like in a victory.

Spoiler: Picture 2
4.png

As you see, there is a small unwanted detail in this second image. The state alteration is still visible on my character's portrait. What I would like is to be able to reset the portraits of all my characters the moment the last enemy is killed.
I know that there is a method which consists of giving the "immortal" state to all enemies to better control what happens when they die. If possible, I would like to avoid having to program this for all of my fights.

Can someone help me please?
My game is too advanced to consider changing the way I display certain states on portraits.
This is what HimeWorks' End Phase Triggers is for.
Thank you for your reply.
I had seen this plugin which seems to be perfect for what I want. But I don't understand at all how I can link the common event I need to the end of the fight.
I will try to understand this plugin better if you are sure it can solve my problem.
You make a troop event with the trigger of Enemy #1 HP <=0.

Inside it, do Conditional Branches to see if all the other enemies are also dead. If yes, call your common event (or just paste its contents into the troop event).

Copy and paste to have a trigger for each of the enemies in the troop, so it doesn't matter which one dies last.

That's all eventing logic that you should, with practice, be able to do on your own 😉

All the plugin does is make sure the battle doesn't end before those troop events get evaluated.
I understand. This should actually solve my problem. Thank you very much ^^

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/common-event-before-the-end-of-a-fight-resolved.164409/