How to toggle a modifier key?

Sorry, I know this is a bit of a repost but I really need this macro since it's important to my work and I can't figure it out. Any help would be really appreciated.

I wanted to make a macro so that when a hotkey is pressed (alt+shift+P) the alt key is held down and it is only released when the hotkey is pressed again (i.e. toggle it like you would with caps lock). However I can't get the press and hold function for modifiers to work at all. I've tried lots of different combinations to try and get this function to work but it never does. Does anyone know how I can solve this problem and/or create the macro that I described above? I've shown screenshots of the press and hold functions I tried but didn't work below.

A post was merged into an existing topic: Press and hold alt (option) key not working