Javascript snippets how to combine?

Hey everyone,
i need to combine these both Snippets to one, can someone help me please.

The first one is for a “One-Page” Design where the Disclaimer and something Special is on a subsite but the mainmenu must work with anchor links but w/o these snippet the links everytime on active if i use e.g. "http://site.com/#x-content-band-1 "
If im using the Links without the TLD in the link, i won’t come back from Subsites to Mainsite and the Anchor.
And “One-Page” Navigation isn’t an Option beacuse my Partners want the Menu on the left Side.

The second One fix the Problem with anchorlinks which comes with the first snippets, i guess.
The Anchorlinks don’t scroll far enough to the top of the page, only shown at the bottom and the content is below outside the screen,

But if i use both snippet, i’ve allready the Problem with always active anchorlinks because the are in a conflict i guess.

first
https://pastebin.com/QLFg5cyZ

second
https://pastebin.com/RdVMygcA

Regards.

I still need some help here :confused:

This is an automated message to notify you that your thread was posted in the wrong forum, and it has been moved to the correct place. A member of our team will be happy to reply just as soon as your thread is up. How support works.

For support, please post all questions in the Support Forum.

For peer to peer conversations with other Themeco customers about tips, customizations, or suggestions you are welcome to use the Peer to Peer Forum (no official support provided here).

Design & Development, Marketing & Media, and Hosting & Optimization are for discussion with fellow Apex members about non Themeco related topics. Please keep this in mind in the future.

Thank-you!