I see from the screenshot that the bars don't scale with distance though, so it must look fairly ridiculous when an enemy is 200m away with a giant red thing above their heads?
It only works in singleplayer of course. you can also disable/enable the display of the HP bars for both sides separately and decide the distance limit for showing the HP bars.