The solution is already making use of a custom master page for normal pages that already have scripts included, but this is specifically for application pages only (to the extent possible).
I saw a solution using a HttpModule to dynamically replace the master file on-the-fly, but it seems like a very inefficient way to do it.
Any suggestions are welcome. The end result must just be that the specific menu item is removed from the actions menu on the permissions page. I have tried using HideCustomAction, but it will not work for that specific menu item (it is working fine for others).