Tried some stuff, at last i found the solution.
Add these to your DefaultEditor.ini to ignore changes to the GeneralProjectSettings.ini, so it doesn’t invalidate your cook.
[CookSettings]
+CookOnTheFlyConfigSettingDenyList=Game:/Script/EngineSettings.GeneralProjectSettings
+CookByTheBookConfigSettingDenyList=Game:/Script/EngineSettings.GeneralProjectSettings
(I’m not sure if both are needed, i just put them for safety)