JavaScript code cannot be overriden using the usual resource directory in config folder trick, that's because JS code is not really meant to be overridable given that it changes with every release and the rest of calibre depends on it. If you want to change actual code you need to run calibre as described here:
https://manual.calibre-ebook.com/develop.html