look into the index.html file of the magazine template. You have this line:
{library}
<script type="text/javascript" src="components/com_comment/joscomment/templates/magazineJoomla/js/custom.js"></script>
{/library}
Do you get the idea?
You can copy the js folder to your wished template,
add the above line of code - changet the code to your template... and then go to the settings in the backend-> under layout I think, you have an option to load libraries. Set it to yes and you should load the js file.