I doubt that it would be the software unless the battery issue only happens with that program and no others. I do not know why the problems exist. There is no quick fix for a defective battery or for bad USB-C ports. You can try Reset the System Management Controller (SMC) on your Mac - Apple Support to see if that may reset the USB ports. Of course, I am assuming you are not connecting a peripheral that is overloading the port. Beyond that, I can suggest reinstalling macOS. You will need an active Internet connection to do the following:
Reinstall El Capitan or Later Without Erasing Drive
Please be sure you back up, if possible.
- Restart the computer. Immediately, at or before the chime, hold down the Command and R keys until the Apple logo and progress bar appear. Wait until the Utility Menu appears.
- Select Disk Utility and click on the Continue button.
- Select the indented (usually, Macintosh HD) volume entry from the side list.
- Click on the First Aid button in Disk Utility's toolbar. Wait until the Done button activates, then click on it.
- Quit Disk Utility and return to the Utility Menu.
- Select Install OS X and click on the Continue button.
And, if the above doesn't help, then you can try this instead:
Install El Capitan or Later from Scratch
If possible, back up your files.
- Restart the computer. Immediately, at or before the chime, hold down the Command and R keys until the Apple logo and progress bar appear. Wait until the Utility Menu appears.
- Select Disk Utility from the Utility Menu and click on the Continue button.
- When Disk Utility loads select the target drive (out-dented entry w/type and size info) from the Device list.
- Click on the Erase button in Disk Utility's toolbar. A panel will drop down.
- Set the partition scheme to GUID.
- Set the Format type to APFS (SSDs only) or Mac OS Extended (Journaled.)
- Click on the Apply button, then wait for the Done button to activate and click on it.
- Quit Disk Utility and return to the Utility Menu.
- Select Install OS X and click on the Continue button.
I asked if there was a place in Finland where you could take the machine. Well, Euronics has shops in Finland:
Country Company Name Brands Branches
Finland Kauppiasosuuskunta Tekniset Euronics, Tekniset 63
I suggest you look into finding one near where you are living if reinstalling macOS does not help.