Right, i forgot one detail. the "TY_RemoveLuck_YEP_EquipCore" plugin also modifies the method i just gave you.
In order for the fix to work you to have to paste the code you added inside "YEP_EquipCore" to "TY_RemoveLuck_YEP_EquipCore" instead.
Make sure to erase the existing "Window_StatCompare.prototype.refresh" method that you find inside the plugin.