Write custom recovery to the phone will end warranty because of changing Knox from 0 to 1.
Write custom recovery to the phone will erase all of your data if the phone has encrypted data partition.
All described operations you are doing at your own risk.
If want saves your data do a backup before start.
The battery should be at least 50% charged before the start.