Custom damage in nether?

I saw a datapack with a bow that does extra damage if it's in the nether and I'm curious if it's possible to do with swords and if so how?
Continue to help post