CPus learn over the long term.
The fastest way to teach your Marth CPU to be lame is to do grounded "poke" (dtilt) until it starts countering you every time you dtilt near him. The AI for the CPU isn't about just copying what a human does over the long term, but is closer to "what works in this situation" (and what ever it defines as a 'situation' is pretty broad when it comes to grounded positions [thats why they play best on FD and suck on battlefield], but is pretty awful at understanding 'getting hit' [although my marth will fair you if you dash after throwing him these days] and recovering/ledges [although it knows how to instant snap the ledge to gimp in the off occasion]).
Eventually you'll have a Marth who from a neutral position will counter anything that has more than 6 frames of start up. Not 100% of the time, no, but it will, I assure you.
It will keep trying to beat you with different things until it reaches counter. Although I doubt I'll ever get consistency out of it, I've had some luck getting the CPU to dair me from ledge jumps as well.
So my CPU will counter if he's standing on the ground not running: dtilt, fsmash, ftilt, any hit of dancing blade beyond the first (if you whiff), shieldbreaker, etc etc