Download the HUDText extension. It has a follow script that can hide the game object when it's off-screen. Use this follow script to make your health bars follow the target.
Your game units should be the ones instantiating your HUD prefab with the health bars and anything else you need in there. Since the game unit is what instantiates the UI prefab, you can set a reference back to the unit right there in your code where you do the instantiation... so I don't understand your trouble. Either have your game unit script reference the instantiated HUD element and update the health slider, or have a script on the HUD element that keeps an eye on the source unit and updates the health itself.