Awarding partial XP for fleeing/surrendering enemy, specifically at end of combat

I'm designing a combat system where you still get partial XP if an event flees or surrendering, as opposed to defeating them normally.

So far, I know I can use a script to add exp when one of these events are triggered. However, I'd like to be able to lump it in with the XP gained at the end of the battle on the same screen.

This also presents another problem because if all enemies flee, the battle end automatically, but if still like to get a victory screen with partial XP awarded.

So as an example, say you're fighting two slimes. If you kill both, you get a victory screen awarding 10 XP. If you kill one and let the other escape, you get a victory screen awarding 7 XP. If both escape, you get a victory screen awarding 4 XP.
That will require a plugin to rewrite the victory screen as well as the default escape mechanism.
It cannot be done without a plugin as you need to modify the screens and functions for that.
I had one idea but I'm not sure if it'll work without a plugin either.

Is it possible to KO an enemy but have it use the escape animation instead? My idea is to swap the enemy with another that is identical but has a lower XP value. Then kill that enemy, but somehow change the animation so it looks like it escaped instead.

Edit: Perhaps I can use a fresh sprite sheet that changes the death animation, then combine that with an effect fading the sprite out.

Edit 2: My idea ended up working! Here's what I did.

I created a second version of the troop with a totally blank sprite sheet and gives a reduced amount of EXP. I also created a skill called "Force Flee." It does nothing except use these commands from Yanfly's Action Sequences:

motion escape: user
opacity user: 0%, 20

When the enemy is programmed to flee, I make it use "Force Flee," transform the enemy into its reduced EXP version, then kill it. This causes the enemy to appear to flee and contributes reduced EXP to the final total.
Moved to: JS Plugin Requests

Original thread: https://forums.rpgmakerweb.com/threads/awarding-partial-xp-for-fleeing-surrendering-enemy-specifically-at-end-of-combat.118108/