macOS applicationDockMenu remove universal items in the app's dockTile

I am developing a cocoa app for macOS and was manipulating the app's dock menu. I realize there are universal menu items such as "Options", "Show All Windows" and "Hide" in every app's dock menu.

In my case, those items/buttons do not work so I want to remove them. For example, "Options -> Keep In Dock" won't work because the executed application is a cloned one and will be deleted after quit(I know it is weird but that's what the app does).

Is there anyway that I can remove one or all of them? I think it might be impossible but a consultation won't do any harm.

Or, can I set the callback of "Show All Windows" or "Hide" programmatically?

Update: I just found applicationWillHide/DidHide to set the callback of "Hide" item. But seems like I can not abort or abort its hide process unless I set the "canHide" window I don't want hide to false.

macOS applicationDockMenu remove universal items in the app's dockTile
 
 
Q