If you need to group those scripts, you can make a regular .js file but with modified function parameters - make all the values sent by PHP actually become function parameters. So, for example,
function change_city_by_nation(nation_id){...}
becomes
function change_city_by_nation(url_from_php, nation_id){...}
etc...
And of course, you need to modify the function bodies and function calls (from the views) afterwards.
However, if you have a function that is used only on a single page, it's perfectly acceptable to leave the JS function there, and embed the PHP values just like you did in your example.