An mpk file is just a zip-file with a different extension. Unzip the mpk, edit the JS, zip the files again, rename it to .mpk. That should do the trick.
To comment on Jalte’s answer, it is important to zip the files as opposed to the folder, otherwise it will not work.
Also you might want to give the widget a different name so that your changes are not overwritten by accident when somebody decides to update the widget from the app store. This you can do in the package.xml
Another way to quickly edit a widget is to use 7zip to open archive.
Then you can find the widget file and extract it to your desktop, edit it, and then drag it back into the archive to replace the original
As Andrej said, if you make changes to an appstore widget and this widget is updated then all your custom code will be overwritten
Hope this helps!