How large can you make each characters script before it actually starts to trunc or worse? I assume he won't use much more than maybe 3-6 magics that exceed those MP costs. From what I assume, you'd check on actionindex and crosscheck on self.currentMP?
Is Vincent's the only pre-action script that actually runs?
do you have an idea for how to best structure a script like that?
I have valid, correct, and concise answers to all of these questions. However, the ultimate conclusion is that nothing can really be done. I'll give you a scenario that would prevent this:
Cloud has 300 MP and you want him to cast a spell that costs 350, but the game actually says it costs 255 (because that's the max). Now first of all, the game will allow him to select the attack in the magic menu. There's the first problem right there. It's still highlighted as if it's valid. There is no way around this. Second, an AI script will see the magic you're trying to cast and see that Cloud doesn't have enough MP. Three things happen:
1) He performs it anyway because there's no way to actually stop him
2) Even if you could stop him, the game's mechanics would still subtract the 255 MP
3) Now he's wasted a turn (if you managed to "stop him") and is down 255 MP on an action he never should have taken.
So an AI would have to do this:
If ( character.MP >= [desired MP cost] )
{
character.MP -= [difference in desired cost vs actual in-game cost]
}
else
{
[stop from performing] //NO WAY TO DO THIS
character.MP += [actual in-game cost] //because the mechanics require it be taken before this script would fire
character.timebar = 255 //to re-grant a turn, but I don't know if this is possible either
}
That's for every magic you want to go over the 255 limit. That shouldn't be much, probably just a few summons and higher-level magic. But like I said before, there's no way to stop Cloud from using it anyway or grant his turn back. The mechanics of the game simply don't allow for an action to be canceled once it's been queued unless the actor dies. Then THAT screws up all the previously attained status effects, especially timed ones.
Ultimately, it's not practical to attempt to do this. It's attempting to alter the mechanics of the game, it lies to the players, and it just can't cleanly be done.