resurrection selector

I have this prototype that basically lets you choose from a list of party members in the "Knockout" state (ie dead!) and it will resurrect (remove Knockout state) for that party member

Its intended to be used with a conventional shaman / priest / healer action event

the healer asks for a donation if the player coughs up then you run the plugin command ...

here's what I have so far
//=============================================================================
// De-Status vendor (shaman/priest/healer)
// by Codifies
// Date: 10/11/2017
//=============================================================================

/*:
* @plugindesc initially designed to resurect player characters
* @author Codifies (bedroomcoders.co.uk)
*
* no params for now but keeping the comment so I know how to add param
* comments if needed
*
* // @ // param xxxxx //name of a parameter you want the user to edit
* // @ // desc yyyyy //short description of the parameter
* // @ // default zzzzz // set default value for the parameter
*/
(function() {
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
var peeps = [];
if (command == "DeStatusTest") {
choices = []; params = [];
$gameMessage.setChoices(choices,0);
var count = 0;
for (i=0;i<4;i++) {
var ai = $gameParty._actors;
var actor = $gameActors.actor(ai);
console.log(actor);
states = actor._states;
for (state in states) {
console.log(states[state]);
if (states[state]=="1") {
choices.push(actor.name());
peeps[count] = actor;
count++;
}
}
console.log(peeps);
}
if (count==0) {
$gameMessage.add("No one needs resurecting!");
return // abort
}
params.push();
console.log($gameMessage);
$gameMessage.setChoiceCallback(function(n) {
if (peeps[n]) {
console.log(peeps[n].name());
for (state in peeps[n]._states) {
console.log(peeps[n]._states[state]);
if (peeps[n]._states=="1") {
peeps[n].removeState(1);
}
}
}
}.bind(this));
}
};

})();

so in an event when you want this list of characters (who are knocked out) just do a plugin command with only
DeStatusTest
in it... a list of knocked out players will be shown, the selected one with be revived.

I'd be interested to hear if anyone has any practical ideas about how it could be improved and what practical suggestions you might have for improving it (other statuses for example)
I've moved the deduction of the money into the plugin : reasons..... (basically less event boiler plate and easier to handle cancellations) plugin command now has a single parameter that is cost

either no one has a use for this or I haven't explained what it does well enough, oh look tumble weed

without feedback or suggestions I can only guess its just useful for me?

I have thought of expanding it to be a more general healer / herbalist as well where a set of status / costs is presented

the idea being the healer can offer to heal blindness etc, rather than potions you can take in the field (they might not exist or could be more expensive)

not too sure the best way to handle this...

Original thread: https://forums.rpgmakerweb.com/threads/resurrection-selector.86991/