Movement Trails Button

I’m editing a module with movement trails. It has the “Erase Movement Trails” button on the toolbar which works as it’s supposed to. However, I want to automatically erase movement trails when another custom button on the toolbar is clicked.

How do I link the Erase Movement Trails to the other button?

Thanks,

Curt