This will not work, as moment when game check for visibility can and will be changed based how game engine will be improved. Most of hooks like this are read-only to prevent instabilities. Not mention that writable unit in this place could easy break every thing like you kill unit when this hook is called.
There is function `tryConcealUnit` that check if unit is not seen by any enemy, its original use was to make unit disappear from memory of enemy if currently is not seen by any body.
You can use this function on "newTurn" to see if is visible or not, with this you can freely update units stats to fit your desires.