Tibia-Stats did an amazing article researching how the distance fighting skill, distance to the target and weapon choice effect on your hit rate:
http://tibia-stats.com/index.php?akcja=6003&research=distance
To summarize it, here is the relevant part to your question. The Maximum hit % is reached at the mentioned distance skill value, for the corresponding weapon and distance to the target:
One-handed weapons
Weapon | Max. hit % | 1 sqm | 2 sqm | 3 sqm | 4 sqm |
| 76% | Dist. 76 | Dist. 29 | Dist. 45 | Dist. 58 |
| 80 % | Dist. 78 | Dist. 31 | Dist. 48 | Dist. 61 |
| 96 % | Dist. 73 | Dist. 30 | Dist. 44 | Dist. 57 |
Compared to their information, I added Royal Stars because I have personally experienced the 96% hit rate but Leaf Star and Glooth Spear have no information on them.
Ammunition for two-handed weapons
Ammunition | Max. hit % | 1 sqm | 2 sqm | 3 sqm | 4 sqm | 5 sqm | 6 sqm |
| 87% | Dist. 70 | Dist. 28 | Dist. 42 | Dist. 57 | Dist. 70 | Dist. 87 |
| 91% | Dist. 73 | Dist. 29 | Dist. 44 | Dist. 59 | Dist. 73 | Dist. 91 |
| 94% | Dist. 76 | Dist. 30 | Dist. 45 | Dist. 61 | Dist. 76 | Dist. 94 |
| 100% | Dist. 77 | Dist. 30 | Dist. 45 | Dist. 59 | Dist. 77 | Dist. 91 |
To this maximum hit % you would add the Hit % modifier of the weapon you are using, so regular Arrows while using an Elvish bow that has a +5% hit modifier would have a resulting 96% hit chance if you reach the distance skill threshold.
As you can notice, the article is a bit outdated and a lot of ammunition has been released since then:
- Spectral Bolt is claimed to have a 93% hit chance according to tibia-stats distance damage calculator.
- Since Prismatic Bolt and Drill Bolt fall between Power and Infernal, we could assume the same 91% hit chance but tibia-stats own calculator puts it at 90% instead, a new tier.
- Vortex Bolt has a 89% hit chance according to tibia-stats calculator, which is a new tier.
- Crystalline Arrows are known to have a 95% hit chance, but the distance skill threshold is not known. We can figure it is between the 94% and 100% tiers which are already very similar.
- I have no data about Envenomed Arrow but using tibia-stats distance damage calculator they show a 93% maximum hit chance, which is a new tier.
- I added in at the 94% tier because it is the maximum hit chance tibia-stats claims in their calculator.
- Simple Arrow has very little information to pull from but from the use I've given it and since that is the minimum tier for arrows, we could put it at the 91% tier.
To answer your question, there is no known formula to know the effect of the distance skill in the hit chance but as you can see it does not have a very high effect. If your distance skill is under 91 try to hit your targets from less than 6 sqm and since the next bump is at distance 77 you shouldn't have much trouble reaching the hit cap for your weapon. Distance skill 77 takes only close to three weeks with offline training!