critter_add_trait(who, trait_type, trait, amount)
Before 4.2.1, calling "critter_add_trait(dude_obj, 0, 77, 2)" is the same as "critter_add_trait(dude_obj, 0, 77, 1)", which only add one rank of the perk.
And yes, the DR bonus is hardcoded in the engine, which only checks if player has the perk.