Start by going to your custom melee attack montage and opening it. If you do not know how to create a montage find the attack animation you want to use and right click on it in the content browser and select Create Anim Montage.

Once in your montage first set the Slot to UpperBodyGroup.UpperBody this is shown in the image below.

Next you need to add the ActivateMeleeDetect and DeactivateMeleeDetect notifys like show in the image above. If you do not know how to add a notify the video below shows you how.

You want to position your ActiveMeleeDetect notify at the time in the animation where you want the melee trace to start (This is when the animation can deal damage to things) and the DeactiveMeleeDetect when you want it to stop, make sure the DeactiveMeleeDetect isnt to close to the end of animation. A good position is about were it is shown in the image below.

Once this is done your montage should now be ready to be used as a melee attack montage for Smart AI.