Simple Scan Ability Script

I know scan ability scripts exist, such as Yanfly's Enemy Info script and the Scan Enemy script by Dark Neon, but neither of these actually accomplish what I want from a scan skill in my game.

What I want is simple, and the Yanfly Enemy Health Bars script comes closest to it, due to its option to hide health bars for certain enemy types until you have defeated that type of enemy in battle at least once. I feel that if I had enough scripting knowledge, I could just modify that script to act how I wanted, so maybe that's a good starting point?

Essentially I want enemy health and mana bars/values to be hidden normally, but if an ability tagged with something like "<scan>" is used on a certain type of enemy, then their health and mana bars/values become accessable information in any battle with them. The other scan ability scripts come close, but they are only good for finding weak and strong elements, or afflicted states, and I just want it simplified to scanning enemies for their health and mana.
Have you considered doing this with a common event instead of a script?  That way you could control exactly what information is called up.
Have you considered doing this with a common event instead of a script?  That way you could control exactly what information is called up.
From what I understand, in order to do this with common events requres about 20+ variables and events in every enemy troop. Not only is this tedious, but it could cause confusion later on if I try to implement special events into battles, so I wanted to avoid it if possible. It seems like a script would be a much simpler solution.
Your understanding is correct.

You'll have to see if anyone comes up with an edit to yanfly's script, then.  Or perhaps someone knows of a simple script which does just this.  I personally haven't seen one, so can't recommend anything.
no - that's why common event and not troop event was suggested. You need nothing in troop events if you use a common event called by a skill.

It's a bit tricky because you need to work blind (outside of the troop window, the event commands for handling enemies don't display the enemy name, only a blank number line), but they will work correctly if you remember which index to use where without variables in troop events. Additionally, the display will only happen at the end of the turn.

You'll need scripts to overcome that limitation...
Try using this script instead of Yanfly's:

http://forums.rpgmakerweb.com/index.php?/topic/697-enemy-hp-bars/

There's a scan feature built-in to reveal HP and/or MP bars. Simply make a Scan state (which you can plug into a skill), then plug the associated number of the state into the script setting where it calls for the Scan state.

You can also set it to remember enemies who have been affected by a Scan state, so once you scan an enemy, their HP/MP bars will appear in every battle afterward.

Original thread: https://forums.rpgmakerweb.com/threads/simple-scan-ability-script.41349/