Few Suggestions. when I know someone is gunning for me (and its obvious) I do these things.
Royal Marrage, Give access, ask for access, boost relations.
You see, those things there, all give stability hits. They DOW you and suddenly they are in the negatives, and then revolts start in their nation. during the war as well as their income is hurt work.
Also, it must be said... if they are beating you, they are beating you. That just means you loose.
You see, this is a game you can win, or loose. If you get beat you loose, suck it the heck up and stop crying. boo hoo I lost in a game, waaaaaaah. I'd hate to see you play an older real time strategy, love to hear you rage after a zergling rush.
But seriously, it happens.
you say the got cores on you out of nowhere, those are called events, probably they got a mission to take that land, or a bad cartography event or something, it happens, its part of the game.
Also if they have to many high of an army for you to fight outright then fight them other ways, go around them and take their land, make them chase you, the longer the war goes on the harder it is for THEM.