Don't know how tricky certain things are in the FF5 engine, but some thoughts occurred:
(Yeah, I'm late to the party. I normally just read the Pandora Box thread.)
Let "Cast" be a command that loads all spells you have active access to.
If no access active, grey it out or even blank it.
If we can assume it can never be manually inserted, we would only need to grey it out when muted or prevented from magic.
This !Cast command could simply be loaded into the character's command menu at the position of the first spell access passive that is equipped.
i.e. Instead of "!White" you equip "White" in the job menu.
When the battle command menu is loaded, that "White" tells the parser to load "Cast" into the menu and look up its pointer, and it keeps going. Any further casting types are left blank as any other passive would be. This is true for whichever valid casting type is first encountered.
RAM for a flag--(when found: test fReplaced; if not true, swap out and set fReplaced=True; else skip to the next one)
ROM for a jmp to switch modes--(One loop always swaps out any passive casting slot it hits but then immediately switches to loop 2 which always treats them as passive. Completion of either leads to the same code block.)
Neither--It swaps out
all valid casting types, but that would look ugly.
(Other options exist, too)
The character's equipped Job skills would need to be unchanged and accessible by the Cast routine for this to work. This
might be a RAM issue, but, even assuming you can't simply use the actual character data, to use the Reset data, you just make sure it runs the above replacement after it loads it. Then you make sure the command gets its equipped spell access data from that stash, and handles the command menu as normal.
Oh, since this would allow for more spell lists to be combined, theoretically, than the game engine presently permits, there is also a chance that there simply wouldn't be enough RAM for the entire concatenated spell list. Someone with more knowledge can answer that chestnut.
edit: Let me clarify something: When I say "Command" I refer to the command that is run when the command is selected in the Battle menu AND the string that labels the option. The Command string tables reduce by switching to a single Cast/Magic command. The command routines also can reduce, opening up pointers for fun & profit.
If you don't also add a "!Cast" selectable Job trait, that string list won't need to change. (Using "Red" for Sage is tolerable) These lists are distinct, as I understand it. The selected trait is indexed on a separate list from the pointer to the command routine and these can differ from the list selected in the Job menu. They may all normally map, though I doubt it, but the distinction and context shift lets us play the game I describe.
Why would you want to, other than to prove you could?
With those changes, Sage is simple a matter of defining a class that has access for multiple magic types, however that is encoded. That, of course, still requires finding the space to store the class and the codes to access, and so on... I'd need more details than I have to be any help, there, though.
(I'd suggest the Sage class set !Fight, !Dualcast, !Cast, and probably !Item. (leaving one slot open)
Some ideas for Sagey Job level bonuses:
Arcane Needle : Reduces target's Def./M.Def./Ignore Reflect
Riddle: Target has a chance to become confused; Sage gains Image
Unravel: Target loses some stage of resistance; all beneficial spells have a chance to dispel; chance to remove status immunity
Sagesight Peep/Scan, but removes Image (and maybe Clear) from target. Maybe also grants a bonus to hit rates in general )
The ability to make magic a list to opt-in in blocks makes several magic related concepts easier to manipulate as a group. Want to turn off magic in a tower, say? Simply make sure !Cast is disabled (the script would merely need to set fReplaced= true or start loop 2 for all characters, or it could ban the command itself.)
If you want flags that can prevent casting of all or specific magic, well, that's the only place you'd need to test for them. (well, Battle and in the Menu, but the routine
could be common. Need to be careful with that discrepancy.)
A character could be banned from White magic due to some dark pact or whatever. This could be a status bit on the character, if general, that is tested here, or it could be a test for the character directly, if specific.
The code for each of the command forms could be consolidated into a few loops and a single command. (routines shared with x-magic?)
The equipable Job skill list would actually
not need to grow, though it probably ought to, while the battle command list would actually shrink.
(If it
doesn't grow, however, Sage would need to include one of the spell access slots from another caster type. Red would look the least strange, methinks.)