Howto integrate JQuery-Plugins?

I have a problem with JQuery and plugins with which I do not get on and hope for help. Specifically it is about a rather small JQuery plugin that displays tabs or an accordion depending on the screen resolution (https://www.jqueryscript.net/accordion/Tiny-Flexible-jQuery-Responsive-Tabs-Plugin-mTab.html).

The order in which the plugin needs to be loaded is:

  1. HTML DOM
  2. CSS mTab
  3. JQuery
  4. JavaScript for mTab (minified)
  5. function call

The HTML DOM is generated in the theme “show.phtml”, CSS and JQuery I load via the layout.phtml

How and where do I have to integrate the plugin (a minified.JS) and then make the function call? Also in the layout.phtml? What command do I need to use to make sure the plugin is not loaded until JQuery is already there. Is it enough to write:

$this->headScript()->appendFile($this->assetUrl('js/jquery-mTab-min.js'));

in the last place?
The function call then as last in the Show.phtml, or? Does this just go inside a tag or does Omeka block this?
Unfortunately, I currently always get the error

TypeError: mTab(...) is not a function

so I suspect the call is failing and the order of how my JavaScript is loaded is wrong.
Thanks for tips and help

Here is an addition: When I call the plugging function via the console of the browser, an error also occurs. That means that the loading of the plugin fails completely.