@Pieter Boelen is on the proper track with the sail hitpoints for purposes of enhancing in the shipyard. The GetRigDamage function is for determining the amount of damage a particular opponent and ammo used during a specific "hit" event during combat; it is triggered from the engine when it determines the projectile trajectory intercepts a particular sail.
The process is as follows:
Engine performs calculation to determine whether the projectile, through flight, intercepts a sail. If calculation is positive for interception, the engine kicks off event DoSailHole, then SHIP_SAIL_DAMAGE. These events are defined in the script code to correspond with script functions ProcessSailDamage, Ship_SailDamage, respectively.
SetEventHandler("DoSailHole","ProcessSailDamage",0);
SetEventHandler(SHIP_SAIL_DAMAGE, "Ship_SailDamage", 0);
The ProcessSailDamage function is the one that calls GetRigDamage where it figures a damage amount based on the type of ammo used; it has no bearing on what it appears the purpose of this development to enhance the sail strength.
Rather, what should be modified is probably the character's base ship sail points, versus the "realship" (i.e. the actual, specific ship object that belongs to a particular character)...these two attributes:
refCharacter.Ship.SP
RealShips[sti(refCharacter.Ship.Type)].SP