I think probably what you're looking for is function.param(0, 1, etc..) and possibly function.returnvalue
when you call the function, you add the parameters to the function call
they then can be accessed using function.param(0, 1, etc..)
you can also then use function set return value
which can be accessed using function.returnvalue
so like:
function "enemy distance"
calculate distance using function.param(0) and function.param(1)
function set return value to the calculated distance
when you call "enemy distance" send it parameters of the enemies locations or their UIDs (if you want to find their locations from in the function)
okay, my example leaves something to be desired, but is that what you're looking for?