You losed the core as you didn't had a conflict with the new owner in the last 50 years ... it may be your ally or not , it works the same
Indeed - it may not be the "perfect" solution, but the check is made only by looking at when you got the core, and when you last had a war with the current owner. Probably because new mechanics would be needed to track "when did I last fight for the province", while "last war" is stored between any pair of countries.