Damage beams are supposed to do full damage when very close to their target, and then lose most of this damage the further you go.
It seems that this is not the case though, and that all ranges use the least amount of damage.
The config and the actual method to calculate the modifier seems to be correct.
The calculation of your actual beam length seems to not work properly though, it is set to the default range (2000 meters) which will result in the lowest possible damage every time.