This question acts as a followup to How is incoming damage calculated in Fallout 4?
I have the formula for how damage is calculated normally, but I am under the impression that at least ballistic weapons have a range modifier to damage, e.g. they do less damage at greater range.
What is the formula for this damage modification?