Just to add, if you are looking to add custom actions, then you do need to do this, if you want to disable, change some of the existing ones, and you have uSync.Complete its all configurable, (although really its just using the above technique ands reading from the config.
https://blog.jumoo.co.uk/2023/v12-supertweaks/