Removing Unnecessary JavaScript

I’ve successfully extracted a particular feature from one site to another. The issue is, there’s code being used for this one feature by 3 different JavaScript files and I’m trying to find something that can help eliminate unused code so I’m not introducing thousands of lines of code to a site that will be going unused and slowing down load times.

Is there anything out there that can help with that?

Your best bet is to use some kind of automated code coverage tool that can show you “hot” and “cold” code paths (basically branches of code that are frequently/infrequently used, respectively). I use Plato for analyzing my JavaScript and there are others, but it does require that your JS be unit testable.