Optimising datapack

I have this datapack ive made which always checks for a specific trim and then gives you an effect

2 problems:

  1. The server tanks when people are online because of im guessing it running so many functions
  2. Saturation is bugged and is different to all the other effects for some reason, any ideas?
Continue to help post