Time required scales logarithmically according to log(teleport_distance), with a minimum time equal to UnitBlueprint.TeleportDelay.
😉
To answer your question in more detail, the following is the "the goods" as far as calculating cost is concerned:
if bpEco.UseVariableTeleportCosts then -- New function here -- energy cost is dist^2 -- time cost is natural log of dist energyCost = math.pow(dist, 2) time = math.log(dist) -- clamp time to teleDelay if time < teleDelay then time = teleDelay end else -- original cost function executed here endYou can add any combination of minimums, maximums, blueprint modifiers, range modifiers, or some crazy thing I could never even imagine, if it suits you.