I've modified the Plugin to now also store the state IDs a battler had just before they died as a game variable, as well, so you'll want to replace your version with the newest one. I've edited my post that has it, so you can either copy or download from there.
In regards to game variables, when you use the "control variables" option in the event editor, you should reserve 7 variable slots that you aren't currently using somewhere. The reason is, this Plugin is going to frequently store values in them, so if you're using the ones the Plugin intends to use, you're going to get odd behavior.
You can tell the Plugin what variable slots you want it to use in the configuration. By default, it uses variables 0001 through 0007, but you're welcome to change them however you'd like. The variables it stores are:
1 - The Id of the Actor or Enemy that just died.
2 - The index of the Actor or Enemy that just died, referencing either the party's battle members or the current troop. For example, if you have a troop with Bat A and Bat B and Bat B dies, this value would be 1 (since Bat A is index 0).
3 - An array of state IDs the battler that just died had before they died (arrays can't really be manipulated through the default interface, so you'll probably only reference this in script commands)
4 - The Id of the Actor or Enemy that last acted (most likely the Actor or Enemy who just killed someone)
5 - The index of the Actor or Enemy that last acted, referencing either the party's battle members or the current troop
6 - The Id of the last action used before the Actor or Enemy died (most likely the skill or item that killed someone)
7 - The type of the last action used (either "skill" or "item")
Spoiler: Example Variables
If you want to use the defaults, you could mark your variables using the "control variables" interface similar to below. If you've already got variables in the 0001 - 0007 sections, then just use the Plugin parameters configuration to change them to something else.
So for your common event, there are a few conditionals we want to write. Let's suppose that you want an actor to gain state 11 if the enemy had state 4 when it died and the actor had state 4 when the enemy died. Your first conditional would be, "Did the enemy have state 4 when it died?"
Since, in the interface, you can't reference enemies by variable in a conditional statement, you'll have to use a script command in your conditional:
Code:
$gameVariables.value(3).indexOf(4) !== -1
The value you want to check is whatever variable you're using to store the states of the enemy that just died. So, in the Plugin configuration, whatever variable you're using for "Target States Variable" would replace the number 3 and whatever state ID you want to check for would replace the number 4. The Target States Variable will store all the states the battler that just died had as an array of state IDs, so you want to check if that array has the state ID 4. If you're using RMMV 1.6, you could do
Code:
$gameVariables.value(3).includes(4)
But if you're using an older version, you'll have to use the indexOf check mentioned above. When you use indexOf on an array, if the array has the value, then you get back its index. If the array does not have it, you get -1.
Next, you want to check if the actor has the same state. Since you can't check actor by variable in a conditional branch, you'll have to use a script command here, too. We have the index of the last battler to act, so we can reference
Code:
$gameParty.battleMembers()
in order to get an array of all the party's battle members. We can then reference our stored index variable to get the correct actor:
Code:
$gameParty.battleMembers()[$gameVariables.value(5)]
You'll want to replace 5 with whatever you have in the Plugin configuration for "Subject Index Variable." In order to determine if a battler has a particular state, we use the isStateAffected function, so the whole thing comes down to:
Code:
$gameParty.battleMembers()[$gameVariables.value(5)].isStateAffected(4)
replacing 4 with whatever the state ID is you want to check.
Finally, we want to add a state to that actor - however, the default interface allows us to add states to actors referencing variables, so no script command necessary here!
Spoiler: Add State By Variable
It's a fair amount of JavaScript to use in your conditionals, but ultimately the common event would look something like this:
Spoiler: Sample Common Event