1. Learn the basics of Javascript in the browser. The web is full with tutorials.
2. Choose one of the cross-platform mobile development frameworks that use Javascript (e.g. Ionic, Capacitor, NativeScript, React Native, Cordova, etc.).
3. Learn the basics of your framework of choice. Each one of them is extensively documented and most documentations guide you through the basics.
4. Design your WebToEpub app (How shall it look? How shall it be used?)
5. Build it with the framework of your choice and port the program logic over from the extension.
This is only a high-level route to your goal and not the only one but probably the simplest one for a novice.
Having a particular itch to scratch is the best motivator for learning how to program because you have a concrete goal in front of you. You have chosen a relatively feasible one, so with the right discipline it is perfectly possible even for a novice.
Good luck!