Have a negative state where a friendly battler aids the enemy rather than follows orders?

Is it possible that there can be a negative state on your friendly battlers where they can help an enemy by using a potion or a healing ability on them rather than follow your orders? If so, how can this be done? Maybe I should create such a plugin for this?
The built-in state restriction Attack an Ally will make the battler help the opposing side.

If you specifically want them to waste items or do other skills, it would be a (probably quick) edit to that restriction to use the regular skill AI choice with the sides swapped.
Edit that restriction via code?
The built-in state restriction Attack an Ally will make the battler help the opposing side.

If you specifically want them to waste items or do other skills, it would be a (probably quick) edit to that restriction to use the regular skill AI choice with the sides swapped.
I honestly feel like this should be a default function of the Charm state. Why isn't it?
I agree that it should be the default function of the Charm state and the restriction should be called "Aid an enemy" rather than the current "Attack an Ally".
I didn't test this, but I would try this:

Make a skill, healing a random enemy. [Heal Foe]
Make a whole new skill type just for that skill. [Autoplay]

Then put the following in the traits of your state:
  • Seal skill type all other than [Autoplay]
  • Seal skill [#1 attack], and skill [#2 guard]
  • Learn skill type [Autoplay]
  • Learn skill [Heal Foe]
  • autoplay
This should do the trick.
@JohnDoeNews But what if I want my friendly battler to do a random thing like attack my friendly battler OR heal my enemy or something else for the enemy battlers?
Also, how can I make that friendly battler under the Charm state to use an item for the enemies or against my allies? I have no idea! Maybe use a plugin or change the built-in JS files?
@JohnDoeNews But what if I want my friendly battler to do a random thing like attack my friendly battler OR heal my enemy or something else for the enemy battlers?
Make all the skills you want for this negative state to have, add them to the traits of the state, and give them the same skill type as the other skill. Then the actor should do both.

Also, how can I make that friendly battler under the Charm state to use an item for the enemies or against my allies? I have no idea! Maybe use a plugin or change the built-in JS files?
Okay, that is a whole different thing. Actually... You can do it the same way:
- Add a skill for each item
- Make the skill do what the item normally does
- Make the skill remove the item
- Give it the same skill type
- add it to the traits of the state
For the most part, you could copy the contents of makeAutoBattleActions() into makeConfusionActions().

There's still nothing in there about using items, specifically, as most people don't want auto-battle to deplete their items (and, honestly, I'd be kinda annoyed by a charmed party member doing so). But it wouldn't be too hard to add in, since items have all the same fields to be evaluated as skills do.

You could also do what @JohnDoeNews suggested, although I'd use a plugin that allows items as a cost for skills since that would allow the auto-battle to evaluate whether it's a legal skill. Just adding an event that removes the item would still allow the skill to be used if you didn't have the item.
There's still nothing in there about using items, specifically, as most people don't want auto-battle to deplete their items (and, honestly, I'd be kinda annoyed by a charmed party member doing so).
Anyone would be. I can still recall the sting of Junpei using up a valuable healing item on an enemy when he got Charmed when I was playing Persona 3.

Thing is, the fact that party members could use items on foes makes the Charm status a real threat and forces you to have a way to cure it before something really annoying or catastrophic occurs. I will never forget Yukari casting Diarahan on the final boss after getting Charmed. That's a full heal spell. Used on a boss when I was nearly done with it. After 13 freaking phases!
Anyone would be. I can still recall the sting of Junpei using up a valuable healing item on an enemy when he got Charmed when I was playing Persona 3.
You mean Stupei? 🤣
You mean Stupei? 🤣
Junpei was a bro. Yukari was never someone I liked a whole lot, due to her personality.

Original thread: https://forums.rpgmakerweb.com/threads/have-a-negative-state-where-a-friendly-battler-aids-the-enemy-rather-than-follows-orders.153068/