Poison Attack passively grants a small amount of attack range when using auto-cast. Since this is basically toggled by the auto-cast, Viper can attack buildings from a higher distance by just turning autocast on.

It should instead work like Ancient Apparition's Chilling Touch. Please look into how Chilling Touch was coded regarding the cast range, and copy it onto Poison Attack (and all other active attack modifier: Frost Arrows, Searing Arrows, Burning Spear, Arcane Orb, Impetus, Glaives of Wisdom, Prowler Freeze, Infernal Blade, Tidebringer, and Walrus Punch)