@auradev - yes, it's intended. OnUseEffects applies a conditional restriction; it doesn't allow for expanding or overriding the target set.
This is the default
testApply:
JavaScript:Game_Action.prototype.testApply = function(target) {
return (
this.testLifeAndDeath(target) &&
($gameParty.inBattle() ||
(this.isHpRecover() && target.hp < target.mhp) ||
(this.isMpRecover() && target.mp < target.mmp) ||
this.hasItemAnyValidEffects(target))
);
};
I.e.
- The target must be alive/dead as appropriate to match the action scope; AND
- The party must be in battle; OR
- The action must be HP Recover type and the target be under full HP; OR
- The action must be MP Recover type and the target be under full MP; OR
- The action must have 1+ "valid" effects.
By default, if an item/skill fails this check, it will be disabled in its menu. As you can see, most validity checks are skipped in battle, presumably to allow for stuff like pre-emptive heals of damage that will land after selecting an action but before that action is performed. (
testApply is also checked on
Game_Action#apply, which determines whether it was "used" or not - e.g. if you targetted revive on someone at low HP but they didn't die before casting.)
You can get around this by adding a effect that never does anything, but still counts as "valid", e.g.
Add State: Death 0% on a skill that targets the living. (For Add State effects it only checks if the target already has the state: the apply chance is ignored.)
Now, my OnUseEffects plugin applies several patches to different methods. The very first patch is to
Game_Action#testApply, for item/skill use from the pause menu:
JavaScript: // Alias! Restrict target actors as appropriate.
void (alias => {
Game_Action.prototype.testApply = function(target) {
return alias.apply(this, arguments) && $.canTarget(this, target);
};
})($.alias.Game_Action_testApply = Game_Action.prototype.testApply);
This just adds another condition: the target must also be valid re any applicable
<target filter> tag.