Can this be achieved?
Sure. Load the JS file using the JS Library component. Now, in the dashboard navigate to that form version and view its resources. You can select the JS Lib and click "Publish resource to another Library". Select either a project or organisation level library to make the script available to other forms.
Can you also tell me how to access a function in a datafield from that library.?