Minecraft wiki entry for Before_1.8, associated text: If the item has been renamed at any point, the penalty is always 2 levels, regardless of further alterations.
For an un-renamed item, the prior-work penalty is 2 levels for each repair or combination an item has been through, not including this one.
When combining two items, you pay both their penalties.