Here is a key operation: agent_get_hit_point
First of all, you need to get the team of agent, when the team is player's team, the hp bar is green. When the agent is enemy, the hp bar will be red. When the agent is friend team, the hp bar is blue.You can use agent_get_team this operation to get team of agent. Of course you should use try_for_agents
Then you need to get every agent's hit point by using agent_get_hit_point. When you get the hp of agent, it is time to show it by using presentation.
When the hp bar show, it should follow the every agent, here is a operation can get agent position: agent_get_position. When agent move, hp bar will move to the new position too. When the agent is killed or wounded, the hp bar will hide.