How to change projectile damage based on distance?

Hey guys,

so I am building a demo for a 3rd person shooter, and i am stuck trying to make damage interacts or changes by distance, so basically the further I am from the enemy the less damage he will take.

thanks,