Collapse Stack To......Extened

Is is possible to make a script that allows users to Collapse the stack with an option of how many modifiers to collapse into one.

For instance say you have your stack in order like this.

Edit Poly
Symmetry
Edit Poly
Editable Poly

I want to be able to collapse from the top most Edit Poly to the Symmetry. Which would result in an Edit Poly Mod that would contain the changes created with those two modifiers.

Thoughts?

AttachmentSize
collapse.jpg165.42 KB