Edit: I solved it, it was a silly mistake in the code.
I am new to modding and I'm stuck in this. It should be easy, I just want my unique unit (which replaces the settler) to be able to enter any territory, just like missionaries do. I tried to copy the code in the game files and after several...