PKHeX is now able to edit parts of the save, known as save blocks. It allows users to export and import various save blocks.
Here's a tutorial on how to get it done.
0. Keep a safe backup of your unedited save, somewhere on your computer. We're not liable if this results in a corrupted save.
1. Make sure you redownloaded and use the latest PKHeX. (Initial version with this feature caused corruption. Additionally, older copies do not have the feature)
2. Load the target save in PKHeX.
3. Now, click on SAV on the tabs.
4. Now, click on the button Block Data
5. Another window should open up.
6. Scroll through the dropdown list at Block Key:.
For this example, I'll be importing the file normal_encount into *Object KNormalEncount (Original quote below, can be found here)
Since I'm importing into *Object KNormalEncount, that is what my screenshot shows.
7. Now that Block Key: is showing the correct value, select Import Current Block.
8. A window should pop-up. Select the correct file to import, then select Open.
In my case, I'm importing the file normal_encount.
9. Now that the file has been imported, close only the first window
10. Then, proceed to File > Export SAV... > Export main
11. Now close PKHeX. If you want to make sure the new save file is not corrupted, reopen PKHeX and try to load the save.
12. You're done. Now reimport the save into your Switch to observe the effects.