I don't know if leppa berries only get it back up to 5pp for ditto, just that when ditto transform they only have 5pp in every move. And wow! Four in a row... I don't know if people (well, at least those who are talking) know for sure when the chances for stuff maximize, but I think the best guess right now is at forty, the same as what chaining methods in 6th gen capped out their benefits at, and also around where it seems this gen that the 4iv becomes a guarantee or near one. Speaking of which, my shiny had only 3 perfect ivs, so it really does seem like I wasn't imagining things when I thought I caught it rather early on in the chain.