You could use something on this lines of /execute <at/as>at @a[nbt={SelectedItem:{id:"minecraft:<id>",name:"<name>"}}] run <command>
in order to run the command, replacing anything in <> with the appropriate option. You can run this as many times as you want, changing those 3 selectors, as long as those are in repeating command blocks, either constantly powered or with "always active" enabled.