Да и вообще, чего так мудрить-то?
Object.prototype.key = function(key){
if (typeof(this.pointer) === 'undefined') this.pointer = 0;
if (!!key) this.pointer = key;
return this.pointer;
}
var FirstObject = {}, SecondObject = {};
FirstObject.key(100);
SecondObject.key(999);
alert(FirstObject.key());