Auto Plates is an addon which is designed to automatically switch on NamePlates when entering combat, and automatically switching them off when combat has been dropped.

It is capable of delayed auto off ( such as waiting 30 seconds after leaving combat to hide plates) up to 3000 seconds, with a minimum of 1 second. It currently contains five modes.

        1, Always toggle nameplates
        2, Toggle, but in instances always show nameplates
        3, Toggle, but leave manual control in instances
        4, Always off
        5, Always on nameplates

Additionally, it supports only friendly plates, for healing, only hostile plates, or both friendly and hostile plates.
Plates are triggered when the player, the target, the focus, the player's pet, any party member or their pet, or any raid member or their pets enter combat, or do any hostile move. Currently healing does not count as hostile, and will not trigger the plates.

    Typing /AutoPlates or /ap will bring up the help info, commands are /ap <mode> or /autoplates <mode> where mode is 1 - 5, or friendly, or hostile.
    Typing /Autoplatesdelay <integer> or /apdelay <integer> will set the delay after combat, before hiding plates. Limits are currently 1 through 3000.


Known bugs:
    There's no direct way to detect if a party or unit is in combat ( at least, no reliable one) and so we're only detecting if a unit or party does hostile actions, then allowing for the timer to kick in and wait out the duration before hiding the plates. Because of this, if your plate delay is set low ( say, one second), the plates flash between hiding, and realizing your allies are still in combat, and showing again. There is no direct way to prevent this problem, except for allowing for a constant UNIT_COMBAT trigger to be run, or to allow it to run just before the timer expires. I took the simplest, lowest impact route, and let the plates hide for a second, before showing again. No major gameplay impact, just a slight flash of the plates. - This WILL NOT happen if you trigger combat before the delay duration expires.