How to add buff to a weapon?

im trying to create a weapon so that when you have it equipped in your hand or hotbar or even if its in your inventory that basically when you have it the item gives you a buff rather its being able to do any of the things the soups can do really like stay under water longer or get more damage done when attacking ect… anyone know how to do this? i know how to do it with armor but cant figure it out for a weapon