I am no pro at balancing items but i learned alot through experience on how to balance almost anything by creating tons of custom heroes.
I don't really think there is a formula but more that you create one for your designed map taking in account different aspects:
-PVP/PvE map -this is the biggest concern than it splits into 2:
PVP:-how long do you intend to keep a map : 10-20 min/40-50/1 hour or more?
-how much money do the players receive (EX:how much you win by killing a mob or doing a side quest,or killing a hero)
Pve:-is it a -save/-load map
-do you want the people to grind or not for gold
And all in all for both of them in general cases you can use(although its not the magical formula for everything and is subject to change in different cases)
HP=Mana, how much you spend on an hp item should be as much spend on an mana item.
-if it's expensive then a hero requiring hp more than mana won't abuse by having alot of mana with cheap money,also a hero that has mana as his primary weapon will fiind it's cost fair since he will use alot of it.
Atribute = 66% or lower price than dmg.
What this mean is that if you take for example an item that gives flat 10 dmg and an item that gives flat 10 strength (your main attribute being str) the flat dmg item should cost 66% value of the strenght item(this value can be reworked depending on how expesnive the item is).
Atack speed flat and atack speed % : This is a real issue if u're using both .
In general you should be able to stack 2 atack speed items that cost 50% less than a bigger item that would give the same benfit on early levels but in %.Because as you level up the flat atack speed becomes rather useless and the perecent one more important hence more expensive.
Special item : This is solely your decision.Try comparing the benefits of your unique item with an item that mimics it flat.
I will take in example your item +32 dmg and 8% chance for a meteor falling (*dealing 125 dmg aoe - i add this to further explain my example).
Now let's think that your hero atacks 13 times( and procs 1 meteor 104% chance after 13 atacks) the damage dealt would be 416(13x32) + 125 dmg x 2(take small skirmish into account 2 targets hit) dealing 666 dmg.
Now we take a flat item that we want to balance along side it 15 damage and 15% chance to proc a lightng trhough the next 5 targets dealing 100 dmg.
It is now just a matter of mathematics.Our second item will deal with 13 atacks :13x15 + 2(targets)x2(chains ,because 195% chance in 13 atacks)x100 = 595 dmg.
Altough it may look weaker the second item is almost as powerfull as the first taking in fact some rng.
So the number say that the first item should be 1.11% more expensive than the second.
Take in account you can make tests and see actualy gameplay to modifiy balances if needed further later into the map.
And finally How to balance the gold cost in comparison between item 1 - item 2-item 3-item 4 - item 5
You do it with testings.Some maps may be created for fights and include big hp pool ,so mana items should definitly be alot more expensive but maybe focus on Moba style such as dota and you might want to balance those out.It is all depending on your map and what defines it.
I know this was alot of match and alot of theory and i am boring but this is how i balance most of the times,hope it helps you.
Cheers.
Blood4u.