Make a backup of your project before following.

Go to the BP_SmartAIComponent and select the Health variable in the My Blueprint panel and in the details panel set Replication to Replicated.

Next go to the Widgets folder in the content browser and create a new widget in the folder called BP_HealthBar.

Click save all button in the content browser and close the project.

Download the files below and unzip them then copy the video below.

Then open the project and go to the BP_MasterAICharacter. Then create a new variable called ShowHealthBar and set its type to Boolean. Set its default value to ticked on if you want the health bars enabled.

Add the highlighted nodes shown in the image below, location at the top of the image.

To enable the health bars set ShowHealthBar to true (Ticked on) in the class defaults of the BP_MasterAICharacter.