Note: This is not about counter attacks... rather it is about a special type of script that is run when an elemental spell is used.
These scripts are rarely used in the game and are rarely noticed.
AFAIK, these are the only monsters that use them:
Spirit series of monsters (Spirit, Soul, Ghost) - react vs Ice
Mech Soldier and Beamer (found only on the Giant or Giant-based levels) - react vs Lightning
I'm not aware of any other monsters at the moment, so feel free to add if I missed any.
One of the cool things about "freezing" the Spirit is that the code says that they "do nothing". Think about the logic of being able to freeze a spirit. It's simply immobile.
So, it was a fun idea of mine to use the IceRod's innate spell on the monsters on Mt. Hobs. It worked nice. They simply stopped attacking altogether.
However, this "feature" or scripted portion was removed in FF4WS (and subsequently FF4A, which probably applies to the PSP version too).
In the Giant, you were supposed to be able to "shock the machines" and make them go haywire (FF4:TAY has an example of that).
However, it was limited to two monsters... but they were a fairly common bunch.
The script is pretty simple... just randomly attack monsters (including themselves) with their designated attack (Beamers with their Beam attack, Machines with Fight).
It works... but they eventually revert back to attacking you. I'm not entirely sure if there's some sort of randomized test to see if they stop running that script,
but I'm leaning towards a limited number that is generated (between 1 and 5?) that they will continue to run the elemental script before running their normal script behavior.
This operates very differently from Charm/Confuse status, where the game checks for the current status before running the script. The monster is compelled to run the attack script even it is attacking itself... multiple times.
The major difference between FF4 SNES and FF4A (probably includes FF4WS and FF4PSP) is that the elemental reaction script is applied correctly to all monsters in FF4A...
In FF4 SNES, it is only applied to one monster that the script applies to. For instance, a 3 Mech Soldier + 2 Beamer group will usually just have the back-most Soldier being affected by the script.
Of course, this is par for the course when it comes to many FF4 scripting bugs.