How to add a modifiers button to you're own script

I’ve been following some videos in helping me make my own script for efficiency. I’ve managed to get most of it done but one thing I can’t find out is adding a modifiers button such as the multires subdivide operation to my script as a button.

Any help would be appreciated

Edit: I manged to add the buttons but they don’t change what the modifier does when I press it.

The easiest way I have found to make scripts is to do it manually and then copy the code from the info panel. The info panel is at the top of the screen, but you’ll have to drag it down a little to see the contents.

Helo
This video may help you out.

Great Luck!