Nevermind, I managed to fix it! Adding a new custom .lua file instead of modding the vanilla one, as per ck2wiki instructions did the trick.
I have a new problem though, and this one got me stumped. For my mod I have increased the amount of patrician families in venice to 12. Everything is working correctly, including sucession in the new families, and the count remains 12 even if one patrician family dies out(that is why I modded the defines).
Here comes the problem: When the head of one of the new families I created is/becomes doge, it dies out on sucession("no dynastic heir"). I attached a screenshot as an example(the patrician in question has 5 able heirs and yet this message appears). Strangely, this only happens with the new patrician families I modded in. When the vanilla patricians becomes elected(i.e: a member of the dandolo or faliero house), inheritance works ok. Can't figure out how to fix it!
https://ibb.co/mn5Wwv