If you had an elective monarchy, couldn't you just vote for a competent heir and have him elected? I'm not sure what determines who your vassals vote for, but I managed to get non-first borns to be elected when I tried a few times (Usually when other children were in line to inherit titles or claims) so I think they follow your vote if they like you enough.
|