Here's a version that I made a while back...
Everstriking
This rare and powerful ability allows the wielder to strike true against nearly any foe. The weapon channels its wielder’s spiritual energy to correct wayward attacks. Whenever the wielder misses, subtract the failed attack roll from the AC of the target to find the difference. For each point of difference, the sword draws 1 hit point from the wielder to correct the attack and successfully strike the target. For example, if the wielder is attacking a fighter with an AC of 25, and the wielder gets a total of 21 to the attack, the wielder takes 4 points of damage and their attack then succeeds. Weapons with this ability will even correct attacks that missed due to cover.
However, if an attack misses due to a roll of a natural 1 or due to a miss chance (such as blur, displacement or an invisible target), the weapon deals the wielder 1 point of Constitution damage, allowing the wielder to reroll for the attack. If their second attack roll still fails due to either of these reasons, the weapon will attempt to correct it yet again, dealing an additional point of Constitution damage to the wielder. This process continues until the wielder successfully strikes the target. The wielder heals the damage to Constitution normally.
Strong divination and necromancy; CL 18th; Craft Magic Arms and Armor, chill touch, true strike; Price: +100,000 gp.
...and here's a lesser version of it, inspired by the Inevitable Crossbow from page 104 of the Arms and Equipment Guide....
Inevitable
These are weapons of fate. Eventually, they will strike true, even when in the hands of the most green warriors. If an attack with an inevitable weapon misses its target, the wielder’s next attack, if directed at the same target, gains an additional +1 insight bonus on the attack roll. If the second attack misses, the insight bonus increases to +2. As long as the wielder continues to attack the same target and continues to miss, subsequent attacks gain bigger insight bonuses, increasing by +1 each time, up to a maximum of +5.
Even if you miss with the fifth attack with a +5 insight bonus, your next attack, if at the same target, retains the +5 bonus. So long as you continue attacking the same target, the bonus remains until you hit. The insight bonus reverts to +0 as soon as you successfully hit your target. This sequence of attacks must occur on consecutive rounds; if a round passes without the wielder attacking the same target, the weapon’s insight bonus reverts to +0. This ability can be placed upon melee, thrown and ranged weapons, but not upon ammunition.
Faint divination; CL 5th; Craft Magic Arms and Armor, true strike; Price: +16,000 gp.
I think the above prices are correct, but I can't be sure. I've got a few different versions of this doc floating around between work, home, and my laptop. I'll check later.