Hmm I think there must be an easier way :/
There is the archer upgrade which gives them a better range isn't it?
Can't you base your item on that upgrade?
native GetHeroProperName takes unit whichHero returns string
local string s = GetHeroProperName(HeroUnit)
local string x
local unit g
loop
exitwhen x == s
set g = CreateUnit(Player(0),herorawcode,x_deadzone,y_deadzone,270)
set x = GetHeroProperName(g)
if x != s then
call RemoveUnit(g)
endif
endloop
set g = null