Change spike walls to only damage hostiles

Hi,
I have never made any mods before, but I would like to change how spike walls work, and this seems like a relatively easy mod? And I would apreciate if anyone would be able to help me with this.
By default spike walls do not harm any wild dinos
With “pasive def hurt wild dinos” setting, spike walls harm every wild dino
Is it possible to change the behaviour of wooden and metal spike walls to damage every hostile wild dino (one that is currently trying to atack a friendly structure/player/tame, or has already attacked one), hostile players, tames and ridden dinos, but not harm friendly players, tames or ridden dinos?
Essentially, I would like to make spike walls “neutral” (instead of default passive, or aggressive with “passive def hurt riderless dinos”) and not cause any friendly fire (even if friendly fire setting is otherwise enabled)

If it is possible to alter the spike wall files (Assuming this is how I would achieve this), would this cause any issues with battle eye/joining multiplayer servers?
I am playing singleplayer at the moment, but may wish to make a small server with a friend at a later point.

Thanks in advance for any help with this! :dodo: